﻿@page "/Log"

<Title Level="3">更新日志</Title>

@foreach (var log in logs)
{
    var lines = log.Value.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim());


    <Card Size="small" Title="@log.Key" Style="width:100%;margin-bottom:5px">

        @foreach (var line in lines)
        {
            var type = line[0];
            var text = line.Substring(1);
            <p style="margin:0">
                @if (type == '+')
                {
                    <Icon Type="plus" Theme="outline" Style="color:green" />
                }
                else if (type == '-')
                {
                    <Icon Type="minus" Theme="outline" Style="color:red" />
                }
                else if (type == '*')
                {
                    <Icon Type="arrow-up" Theme="outline" Style="color:blue" />
                }
                <span style="margin-left:5px">@text</span>
            </p>
        }
    </Card>

}

@code{

  public static Dictionary<string, string> logs = new()
    {
        {
            @"2021.0520",
            @"+X轴和Y轴增加隐藏功能
              +Y轴增加次要轴功能"
        },
        {
            @"2021.0514",
            @"+支持某个字段作为分组依据进行分组
              +增加基本的数据筛选支持"
        },
        {
            @"2021.0509",
            @"+柱状图和点的图增加动画"
        },
        {
            @"2021.0501",
            @"+文档增加更新日志
              +Title组件增加文本位置属性
              +Y轴增加主要和次要的单位和网格线
              +X轴增加网格线
              *优化Y轴刻度计算算法
              +坐标轴增加标签位置和文字偏移"
        }


    };
}